package Book;

/**
 * 书架
 */
public class BookList {
    private Book[] books;
    private int usedSize;
    private int defaultSize = 3;
    public BookList() {
        books = new Book[defaultSize];
        this.books[0] = new Book("三国演义","罗贯中",18,"历史类");
        this.books[1] = new Book("水浒传","施耐庵",32,"武侠");
        this.books[2] = new Book("红楼梦","曹雪芹",24,"恋爱");
        usedSize = 3;
    }

    public int getDefaultSize() {
        return defaultSize;
    }

    public int getUsedSize() {
        return usedSize;
    }

    public void setUsedSize(int usedSize) {
        this.usedSize = usedSize;
    }

    public void setBooks(int count, Book books) {
        this.books[count] = books;
        this.usedSize++;
    }

    public Book[] getBooks() {
        return books;
    }

    public void setBooksSpace(int newDefaultSize,Book[] books){
        this.books = books;
        this.defaultSize = newDefaultSize;
    }

}
